BGP MPLS IP VPN - Summary based on RFC 4364

IP VPN Overview

BGP MPLS VPN overview



  • CE sends routes to PE
  • PE employs BGP to exchange the routes of a particular VPN among the PE routers that are attached to that VPN
  • Routes from  different VPNs remain distinct and separate, even if two VPNs have an overlapping address space
  • BGP distributes the VPN route along with MPLS label for that route
  • Transport could be of MPLS LSP or IP GRE 



Site Core


  • Sites connected by backbone. 
  • Backbone is a private infrastructure build and maintained by service providers. This could span across countries.
  • Two sites have IP connectivity if some VPN has both sites
  • Site could be part of more than one VPN . Owners of the site : customers 
  • Backbone network contains PE and P routers. Owned by service providers
  • Customers obtain VPN service from service providers
  • Two VPN may have overlapping address space

VPN Routing and Forwarding (VRF)
Attachment circuit

  • AC can be attached with one or more VRF via config. Simple case one AC attached to one VRF.
  • AC attached to VRF is called VRF attachment circuit
  • AC not associated with any VRF -> default forwarding table  [public routes]
  • AC associated with VRF -> VRF  table  [private routes]
  • Communication (via PE routers) is prevented between any pair of VPN sites   that have no VPN in common

Controlling Route Distribution

Route distribution
PE1 PE2
  • PE1 learn IPv4 routes from CE (dynamic/static)
  • PE1 install the route in the VRF  (AC attached VRF)
  • PE1 translate the route to VPN-IPv4 route using RD
  • PE1 select best VPN-IPv4 routes (BGP decision process) 
  • PE1 distribute the VPN-IPv4 route to peers (PE2)    
  • PE2 select best VPN-IPv4 routes (BGP decision process) 
  • PE2 convert VPN-IPv4 route to IPv4 route
  • PE2 import IPv4 route to one or more VRF
  • PE2 may distribute IPv4 route to CE


VPN-IPv4 Address Family

VPN IPv4 family


  • PE routers use BGP to distribute VPN routes to each other using VPN-IPv4 address family
  • Each VPN to have its own address space, which means that a given address may denote different systems in different VPNs


VPN Route family




IP VPN Label Allocation


Method Egress PE
Label Per VRF   IP destination looked in VRF routing table to find egress AC (attachment circuit)
Label Per AC    Route the packet based on label lookup.ARP lookup needed for datalink encap
Label Per Route  Route the packet based on label lookup Flexible incase of egress AC changes (no need   of new label for the route)


Route Distribution Among PEs by BGP


VPN flow
  1. PE1 learns site route R
  2. PE1 advertise VPN-IPV4 route to PE2 via BGP. 
    • Uses its own address as nexthop
    • Assign label to route R
  3. PE2 installs route R in its VRF 
  4. PE2 receives packet to remote destination R. 
    • Identify the VRF using incoming AC and lookup destination IP
    • Encapsulate the IP packet with transport MPLS label and VPN route label
    • Forward to PE1
  5. At PE1
    • Remove transport MPLS label
    • Identify VRF using VPN label also remove VPN label
    • Lookup IP destination in VRF and forward to egress AC

Route Target (RT) Attribute


Route Target


  • Route Target is a BGP attribute associated with VPN route
  • VPN-IPv4 route associated with one or more RT
  • Export Targets : Route received from site S attached with RTs in a VRF
  • Import Targets: Determine route from PE accepted in VRF or not

RT


Mesh VPN Vs Hub and Spoke VPN

hub and spoke

mesh


RD vs RT


Route Distinguisher Route Target
Uniquely identifies routes within a VPN Controls the import and export of routes between VPNs
Ensures that routes from different VPNs with overlapping IP addresses remain distinct within the MPLS network Determines which routes should be imported or exported into a specific VPN based on matching RT values
VPN-IPv4 NLRI Extended community

How PEs Learn Routes from CEs

CE to PE


How CEs Learn Routes from PEs

  1. PE distribute a default route to CE  (OR)
  2. CE can simply configured with default route pointing to PE  (OR)
  3. PE distribute VRF route to CE. If the site of origin matches with CE’s site then that route should not be distributed to CE.

Site of Origin
This attribute is needed in some cases to ensure that a route learned from a particular site via a particular PE/CE connection is not distributed back to the site through a different PE/CE connection. 

site of origin




Multi-AS backbone 

Option 1: VRF-to-VRF connections at the ASBR


Multi AS VPN


  • PE1 and PE2 are ASBR with eBGP 
  • PE1 and PE2 has multiple sub interfaces (1 for each VPN)
  • PE1 treat PE2 as CE role. PE2 treat PE1 as CE 
  • Each PE distribute route via eBGP unlabeled routes 



Option 2: eBGP VPN-IPv4 route from AS to AS

eBGP Multi AS VPN



  • PE1 and PE2 are ASBR with eBGP 
  • PE1 and PE2 connected by single interface
  • PEs treat each other as another PE in the backbone
  • Each PE distribute route via eBGP VPN-IPv4 labeled routes 



Option 3: eBGP multihop VPN-IPv4 route

eBGP multihop Multi AS VPN


  • ASBR PE no need to maintain and distribute VPN-IPv4 routes
  • PE1 maintain list of /32 PE routes in AS 100. PE2 maintain list of /32 routes in AS 200
  • Both distribute these routes each other
  • PE3 and PE4 are in different AS. They form eBGP multihop peering
  • PE3 and PE4 distribute route via eBGP VPN-IPv4 labeled routes 
  • PE3 to PE4 has multi AS MPLS LSP for transport

Accessing the Internet from a VPN

Using Non-VRF interface

Internet in VPN



  • Some site in the VPN get internet access via internet gateway which is attached to non VRF interface.
  • PE router use default forwarding table to route internet traffic
  •  Site have internet access distribute default route to connected PE
  • PE in turn distribute the routes to other PEs. So that other sites can reach internet.
  • No route leak between VRF and default VRF needed.


Using VRF interface

Internet in VPN


  • Site access via VRF interface.
  • PE search IP destination first in VRF forwarding table if there is no match then it will search in default forwarding table.
  • If match found in default forwarding table packet forwarded to internet.
  • Some of the VRF route need exported to internet forwarding table

What Next ?

  •  Read the RFC
  •  Learn practical configuration example
  •  Learn the practical VPN design



Comments

Popular posts from this blog

EVPN - Summary based on RFC 7432

Summary of RFC 3031 MPLS